package com.ids.actions;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.ids.bean.UserCreationType;
import com.ids.service.UserCreationScreenService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class UserCreationScreen extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private List<UserCreationType> designationId;
	private List<UserCreationType> roleId;
	private List<UserCreationType> reportingTo;
	
	public String execute() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		designationId = UserCreationScreenService.getInstance().getDesignationId();
		setDesignationId(designationId);
		HttpServletRequest request = ServletActionContext.getRequest();
		roleId = UserCreationScreenService.getInstance().getRollId();
		setRoleId(roleId);
		reportingTo = UserCreationScreenService.getInstance().getReportingTo();
		setReportingTo(reportingTo);
		request.setAttribute("reportingTo", reportingTo);
		session.put("reportingTo", reportingTo);
		return SUCCESS;
	}

	public List<UserCreationType> getDesignationId() {
		return designationId;
	}

	public void setDesignationId(List<UserCreationType> designationId) {
		this.designationId = designationId;
	}

	public List<UserCreationType> getRoleId() {
		return roleId;
	}

	public void setRoleId(List<UserCreationType> roleId) {
		this.roleId = roleId;
	}

	public List<UserCreationType> getReportingTo() {
		return reportingTo;
	}

	public void setReportingTo(List<UserCreationType> reportingTo) {
		this.reportingTo = reportingTo;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
